// 封装产品现关的数据接口
import request from '@/utils/request'
import type { BrandListResult,BrandDetailResult, AddOrUpdateBrandParams, UpdateBrandParams } from '@/types/product/brand'

// 获取品牌数据
export const getBrandListAPI = (page: number, limit: number) => {
    return request.get<any, BrandListResult>(`/admin/product/baseTrademark/${page}/${limit}`)
}

// 删除品牌数据
export const deleteBrandAPI = (id: number) => {
    return request.delete<any,any>(`/admin/product/baseTrademark/remove/${id}`)
}

// 新增品牌
export const addBrandAPI = (data: AddOrUpdateBrandParams) => {
    return request.post<any,any>('/admin/product/baseTrademark/save',data)
}

// 修改品牌
export const updateBrandAPI = (data: UpdateBrandParams) => {
    return request.put<any,any>('/admin/product/baseTrademark/update',data)
}

// 通过id获取品牌信息
export const getBrandByIdAPI = (id: number) => {
    return request.get<any,BrandDetailResult>(`/admin/product/baseTrademark/get/${id}`)
}